Stack overflow compiling regular expression: too complex